/*
 * @lc app=leetcode.cn id=2016 lang=cpp
 *
 * [2016] 增量元素之间的最大差值
 */
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>

using namespace std;
// @lc code=start
class Solution {
public:
    int maximumDifference(vector<int>& nums) {
        int ret = -1;
        for(int i = 0;i < nums.size()-1;i++) {
            for(int j = i+1;j < nums.size();j++) {
                if(nums[j] > nums[i]) {
                    ret = max(ret,nums[j] - nums[i]);
                }
            }
        }
        return ret;
    }
};
// @lc code=end

